<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
  {load href='/static/css/bootstrap.css'}
  {load href='/static/css/all.css'}
  {load href='/static/js/jquery-3.4.1.min.js'}
  {load href='/static/js/bootstrap.min.js'}
  {load href='/static/js/bootbox.min.js'}
  <style>
    body{font-size: 12px}
    .pagination{float:right}
    .pagination>li{margin-left: 4px;}
    .btn{
      width: 80px; /* 设置按钮宽度为 80 像素，可根据实际需求调整数值 */
      height: 30px; /* 设置按钮高度为 30 像素，可根据实际需求调整数值 */
      font-size: 12px; /* 同时可以适当调小按钮文字的字体大小，让整体更协调 */
      padding: 5px 10px;
    }
    .form-control{
      height: 30px;
    }
  </style>
</head>
<body>
<div class="container-furid" style="padding: 0px">
  <div class="row" style="padding-left: 20px">
    <form class="form-inline" action="" style="margin: 10px 0">

      <input id="key" type="text" class="form-control" name="key"  placeholder="输入用户姓名/医生姓名">&nbsp;&nbsp;

      <button type="submit" class="btn btn-primary" id="search"><span class="fa fa-search"></span>&nbsp;&nbsp;搜索</button>
    </form>
  </div>
  <table class="table table-hover">
    <tr><th>id</th><th>姓名</th><th>性别</th><th>年龄</th><th>看诊医生</th><th>病情</th><th>状态</th><th>预约时间</th><th>操作</th></tr>
    {volist name='data' id='v'}
    <tr><td>{$v.patientid}</td><td>{$v.patientname}</td><td>{$v.sex}</td><td>{$v.age}</td><td>{$v.doctorname}</td><td>{$v.patientstate}</td><td>{$v.state}</td><td>{$v.rtime}</td>
      <td><button class="btn btn-danger" onclick="del({$v.num})"><span class="fa fa-trash-alt"></span>&nbsp;删除</button></td></tr>
    {/volist}
  </table>
  {$data|raw}
</div>
</body>
</html>
<script>
  function del(id){
    bootbox.confirm("确实要删除该记录吗",function(res){
      if(res){
        $.get("/index.php/hospital/patientreserve/del",{'id':id},function(res1){
          if(res1==1){
            bootbox.alert("删除记录成功",function(){
              window.location.reload();
            })
          }
        })
      }
    })
  }
</script>